import Vuex from "vuex";
import Vue from "vue";
Vue.use(Vuex);
export default new Vuex.Store({
  state: {
    token: "",
    name: "",
    avatar: "",
    roleList: [],
  },
  mutations: {
    setToken(state, token) {
      state.token = token;
    },
    setName(state, name) {
      state.name = name;
    },
    setAvatar(state, avatar) {
      state.avatar = avatar;
    },
    setRoleList(state, roleList) {
      state.roleList = roleList;
    },
  },
});
